package com.earthea.datasource.lock;

import com.earthea.api.lock.LockProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.concurrent.locks.Lock;

@Service
public class LockInMysqlProvider implements LockProvider {
    @Autowired
    private LockRepository lockRepository;

    @Override
    public Lock getLock(String lockId, long timeout) {
        return new LockInMysql(lockId, timeout, lockRepository);
    }
}
